CXXSOURCES := $(shell find . -name "*.cpp")
OBJECTS := $(CXXSOURCES:.cpp=.o)
DEPENDENCIES := $(CXXSOURCES:.cpp=.d)
CXXFLAGS := -O2 -g -Wall `sdl-config --cflags` -I../TinyXML
LIB := libsi.a

all: $(LIB)

$(LIB): $(OBJECTS)
	$(AR) rv $@ $^

	
%.d:%.cpp
	g++ -MM $(CXXFLAGS) $< | sed 's/\(.*\).o:/\1.o \1.d:/' > $@
	
-include $(DEPENDENCIES)

clean:
	rm -f *.o *.a *.d
	
.PHONY: all clean
